#coding=utf8
import gevent
import abu.rpc

from proto.auth import auth_pb2 as auth

@abu.rpc.impl
class AuthService(auth.AuthService):
	@abu.rpc.ret
	def Check(self,controller,req):
		print req.account
		print req.passwd
		resp = auth.UserAuthResp()
		resp.ret = True
		return resp

service = AuthService()
handler = abu.rpc.Handler(abu.rpc.Transport,service)
server = gevent.server.StreamServer(('',10086),handler)
app = abu.rpc.Application(server)
print 'serving...'
app.run()
